package com.itheima.zuoye2;

import java.util.ArrayList;

public class Test2 {
    public static void main(String[] args) {
        ArrayList<Student> students = new ArrayList<>();
        students.add(new Student(1,"张无忌","河北"));
        students.add(new Student(2,"张三丰","河南"));
        students.add(new Student(3,"赵敏","蒙古"));
        students.add(new Student(4,"周芷若","四川"));

        for (Student student : students) {
            if (student.getName().equals("张三丰")){
                student.setAddress("山东");
            }
            System.out.println(student);
        }
    }
}
